import { PureComponent } from 'react';
import {
	Row,
	Col,
	Form,
	Input,
	Select,
	Modal,
	DatePicker,
	Button,
  Upload,
  Icon,
  message
} from 'antd';
import styles from './ProUserList.less';
const FormItem = Form.Item;
const { Option } = Select;
const { TextArea } = Input;

@Form.create()
class IdentifyInfoModal extends PureComponent {

	constructor(props) {
	    super(props);
	    this.state = {

	    }
	}


	okHandle = () => {
		const { form,handleAddByIdentifyInfo } = this.props;
		form.validateFields((err, fieldsValue) => {
			if (err) return;
			form.resetFields();
			handleAddByIdentifyInfo();
		});
	};

  render() {
  		const {
				modalVisibleByIdentifyInfo,
				form,
				handleModalVisibleByIdentifyInfo,
			} = this.props;

      const props = {
        name: 'file',
        action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
        headers: {
          authorization: 'authorization-text',
        },
        onChange(info) {
          if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
          }
          if (info.file.status === 'done') {
            message.success(`文件上传成功`);
          } else if (info.file.status === 'error') {
            message.error(`文件上传失败`);
          }
        },
      };
return (
    <Modal
width={600}
centered
destroyOnClose
title="组织鉴定录入"
visible={modalVisibleByIdentifyInfo}
onOk={this.okHandle}
onCancel={() => handleModalVisibleByIdentifyInfo()}
>
<Form  layout="vertical">


    <Row gutter={{ md: 8, lg: 24, xl: 48 }}>

        <Col  md={24} sm={24}>
	        <FormItem  label="">
	        	<Button type="primary" style={{width: '100%'}}>组织鉴定信息录入</Button>
	            {form.getFieldDecorator('is_superior_office',{
	            	rules: [{ required: true, message: '鉴定信息不能为空！',whitespace: true }],
	            })(<TextArea rows={4} style={{height: "260px"}}/>)}
	        </FormItem>
        </Col>
        <Col  md={24} sm={24} style={{marginTop: '-15px'}}>
          <Upload {...props}>
            <Button>
              <Icon type="upload" /> 上传文件
            </Button>
          </Upload>
        </Col>
    </Row>


</Form>
</Modal>
);
  }

}

export default IdentifyInfoModal;
